package org.zjsru.user.mapper;

import org.zjsru.user.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Insert;

public interface UserMapper {
    
    @Select("select * from tb_user where id = #{id}")
    User findById(@Param("id") Long id);

    @Select("select * from tb_user where username = #{username}")
    User findByUsername(@Param("username") String username);

    @Insert("INSERT INTO tb_user (username, password, phone, email, address, create_time, update_time) " +
            "VALUES (#{username}, #{password}, #{phone}, #{email}, #{address}, #{createTime}, #{updateTime})")
    int insert(User user);
}